<?php
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
?>




<?
//新表格没有数据，插入一条默认数据

$_setting=select_lines_all_items($table_Prefix . "setting", "nid", "nid = 1 ");

if(count($_setting)<1)
{
    $_setting_tmp['ai_name']="";
    $sql = insert_data($table_Prefix . "setting", $_setting_tmp, "1,''");
    mysql_query($sql) or die (mysql_error().$sql);
}


//这里是设计上传文件的部分：包含图片和附件。视频也应该用这种形式上传
//统一设置一下保存图片的路径
$_uf['path'] = ROOT_PATH_ . "/uploadfiles/";


//上传logo
if (is_uploaded_file($_FILES['logo']['tmp_name'])) {
    $_uf['upfile']       = $_FILES['logo'];
    $_info               = upload_file($_uf);
    $_REQUEST['ai_logo'] = $_info['name'];
    $icon                = $_REQUEST['ai_logo'];

}

//上传icon
if (is_uploaded_file($_FILES['icon']['tmp_name'])) {
    $_uf['upfile']       = $_FILES['icon'];
    $_info               = upload_file($_uf);
    $_REQUEST['ai_icon'] = $_info['name'];
    $icon                = $_REQUEST['ai_icon'];

}




//更新通知设置
$sql   = update_date($table_Prefix . "setting", $_REQUEST, "nid", "1");
$query = mysql_query($sql) or die (mysql_error().$sql);
mysql_close($con);
?>




<script type="text/javascript">
    alert("输入信息已保存，点击确认返回继续操作.");
    document.location.href = "system.php?sys_part=setting";
</script>











